

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/insert1.png">
  <link rel="icon" href="/img/insert1.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  
    <meta name="description" content="无聊的人生只剩下无尽的空虚。">
  
  <meta name="author" content="Mike Taylor">
  <meta name="keywords" content="我的博客">
  
  <title>PhotoShop基础 - Mike Taylor</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10.4.0/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
  



<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"gitee.com","root":"/","version":"1.8.8","typing":{"enable":true,"typeSpeed":30,"cursorChar":"|","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"onlypost":false},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null}}};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
</head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>Mike Taylor's</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                主页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                日志
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                目录
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                个人
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="PhotoShop基础">
              
            </span>

            
              <div class="mt-3">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-author" aria-hidden="true"></i>
      Mike Taylor
    </span>
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2021-05-10 12:46" pubdate>
        2021年5月10日 下午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.2k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      25
       分钟
    </span>
  

  
  
    
      <!-- 不蒜子统计文章PV -->
      <span id="busuanzi_container_page_pv" style="display: none">
        <i class="iconfont icon-eye" aria-hidden="true"></i>
        <span id="busuanzi_value_page_pv"></span> 次
      </span>
    
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">PhotoShop基础</h1>
            
              <p class="note note-info">
                
                  本文最后更新于：2021年5月24日 下午
                
              </p>
            
            <div class="markdown-body">
              <h1 id="第十章-PhotoShop基础"><a href="#第十章-PhotoShop基础" class="headerlink" title="第十章 PhotoShop基础"></a>第十章 PhotoShop基础</h1><p><strong>课程提要</strong></p>
<ul>
<li>认识PhotoShop图像基础</li>
<li>工具使用与快捷操作</li>
<li>图片优化</li>
<li>精灵图</li>
</ul>
<p>安装PS和cutterman插件。</p>
<h2 id="10-1-基本概念"><a href="#10-1-基本概念" class="headerlink" title="10.1 基本概念"></a>10.1 基本概念</h2><ul>
<li><p>PS由美国Adobe公司开发的一款用来处理图像的软件。Adobe开发了另外一款软件Illustrator(AI)，它用来作图，主要跟加拿大开发的CorelDRAW抢占市场。</p>
<p>PS用来处理位图的，AI用来处理矢量图。</p>
</li>
<li><p>位图是由像素点组成的，文件较大，放大会失真，一般用来表示人物、风景等；矢量图由线条组成，文件较小，放大后不会失真，一般用来表示工程图等，由若干个几何图形拼接而成。</p>
<ul>
<li>PS使用位图来表示黑白图像，其逻辑为每一个像素对应一个数据位。位图又称为点阵图，是一系列像素组成的可识别的图像，位图图像与分辨率有关，任何位图图像都含有有限数目的像素。</li>
<li>矢量图与分辨率无关，其形状通过数学方程描述，由边线和内部填充组成。</li>
</ul>
</li>
<li><p>分辨率：又称解析度/解像度，可分为：显示分辨率、图像分辨率、打印分辨率、扫描分辨率等。</p>
<ul>
<li>图像分辨率：单位英寸中所包含的像素点数，分辨率越高，图像越清晰，但是相应的文件也越大。</li>
</ul>
</li>
<li><p>位分辨率：又叫色彩深度或位深度，批一个像素中，每个颜色分量（R,G,B,Alpha通道）的比特数。</p>
<ul>
<li><p>位指的是二进制或比特(bit)。</p>
</li>
<li><p>常见的位分辨率：</p>
<ul>
<li>1位：两种颜色（黑白两种）。</li>
<li>2位：四种颜色。</li>
<li>3位：八种颜色（用于早期的电脑显示器）。</li>
<li>8位：256种颜色，灰阶，有256种灰色（包括黑白）。</li>
<li>16位：可以组合出64K种颜色。</li>
<li>24位：2^24种颜色，真彩色，可以提供比肉眼能识别更多的颜色，主要用于拍摄照片。</li>
</ul>
<p>位数越高，越接近生活中的真彩色，但文件也就越大。</p>
</li>
</ul>
</li>
<li><p>网页所支持的图片格式</p>
<ul>
<li><p>.jpg：压缩格式图片，24位颜色存储单个位图。</p>
<p>支持最高级别的压缩，文件相应变小，但这种<strong>压缩是有损耗</strong>的，压缩率越大的图片，显示的内容就越模糊。</p>
</li>
<li><p>.png：一种<strong>无损压缩</strong>的位图图形格式，是网页常用的图片格式，原因是它压缩比高，生成文件体积小。同时支持背景透明效果，使彩色图像的边缘能与任何背景平滑的融合，从而彻底消除锯齿边缘。</p>
</li>
<li><p>.gif：可以存储多幅彩色图像，如果把存于一个文件中的多幅图像数据逐幅读出输出到屏幕上，就可以构成一种最简单的动画，也就是我们常见的动图。GIF图片不一定就是动图，其也可以是一张图片，由于其具有<strong>高压缩</strong>的算法，所以网页中也常有出现不是动图的GIF图。</p>
</li>
<li><p>.svg：</p>
<p>HTML 5 新增的矢量图，一般用来作为图标字符。</p>
</li>
<li><p>Base64（图像编码）：设计时把图像文件解析成字符编码，浏览器会自动将其再还原为图像。图像越大，编码量越大，所以一般不对大图做base64编码处理。</p>
<p>Base64图片编码 <a href="https://tool.oschina.net/encrypt?type=4">网站</a></p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&#x27;编码&#x27;</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">&quot;&quot;</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>由于编码量大，一般不用这种方法。</p>
</li>
<li><p>.ico或.cur：图标文件，一般用作网站的LOGO。</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs html">/*link:favicon*/<br><span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">&quot;shortcut icon&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;image/x-icon&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;路径&quot;</span>&gt;</span><br></code></pre></td></tr></table></figure>
</li>
<li><p>.psd：psd是PS所特有的文件格式，它含有图层。一般UI工程师给的UI图是psd格式，可以用它切图。</p>
</li>
</ul>
</li>
</ul>
<h2 id="10-2-SVG矢量图使用方法"><a href="#10-2-SVG矢量图使用方法" class="headerlink" title="10.2 SVG矢量图使用方法"></a>10.2 SVG矢量图使用方法</h2><ul>
<li><p>进入 [官网](<a href="https://icomoon.io/">Icon Font &amp; SVG Icon Sets ❍ IcoMoon</a>) </p>
</li>
<li><p>上传SVG图导入网站，选中后下载。</p>
</li>
<li><p>使用：将fonts、style.css复制到项目中。</p>
</li>
<li><p>将style.css引入到网页文件中。</p>
</li>
<li><p>使用：</p>
<p>用类名引入图标，并在图标名前添加前缀icon-。</p>
<p>像处理文字一样写大小和颜色。</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">&quot;en&quot;</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">&quot;UTF-8&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>加载SVG图片<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">&quot;stylesheet&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;./svg/style.css&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><br><span class="css">        <span class="hljs-selector-tag">span</span>&#123;</span><br><span class="css">            <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#8080ff</span>;</span><br><span class="css">            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">30px</span>;</span><br>        &#125;<br>    <span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;icon-01&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span><br></code></pre></td></tr></table></figure>

</li>
</ul>
<h2 id="10-3-PS工具使用与快捷键操作"><a href="#10-3-PS工具使用与快捷键操作" class="headerlink" title="10.3 PS工具使用与快捷键操作"></a>10.3 PS工具使用与快捷键操作</h2><table>
<thead>
<tr>
<th align="center">功能</th>
<th align="center">快捷键</th>
</tr>
</thead>
<tbody><tr>
<td align="center">新建文件夹</td>
<td align="center">Ctrl+N</td>
</tr>
<tr>
<td align="center">打开文件</td>
<td align="center">Ctrl+O</td>
</tr>
<tr>
<td align="center">保存文件</td>
<td align="center">Ctrl+S</td>
</tr>
<tr>
<td align="center">关闭文件</td>
<td align="center">Ctrl+W</td>
</tr>
<tr>
<td align="center">打开/隐藏图层调板</td>
<td align="center">F7</td>
</tr>
<tr>
<td align="center">前景色填充</td>
<td align="center">Alt + Delete</td>
</tr>
<tr>
<td align="center">背景色填充</td>
<td align="center">Ctrl + Delete</td>
</tr>
<tr>
<td align="center">交换前景色/背景色</td>
<td align="center">X</td>
</tr>
<tr>
<td align="center">前景色/背景色还原为黑白色</td>
<td align="center">D</td>
</tr>
<tr>
<td align="center">取消选区</td>
<td align="center">Ctrl + D</td>
</tr>
<tr>
<td align="center">变换大小和旋转方向</td>
<td align="center">Ctrl + T</td>
</tr>
<tr>
<td align="center">移动工具</td>
<td align="center">V</td>
</tr>
<tr>
<td align="center">变换形状</td>
<td align="center">shift + 鼠标</td>
</tr>
<tr>
<td align="center">沿中心缩放</td>
<td align="center">Alt + Shift</td>
</tr>
<tr>
<td align="center">缩放工具</td>
<td align="center">Z</td>
</tr>
<tr>
<td align="center">选框工具</td>
<td align="center">M</td>
</tr>
<tr>
<td align="center">抓手工具</td>
<td align="center">H</td>
</tr>
<tr>
<td align="center">切片工具</td>
<td align="center">C</td>
</tr>
<tr>
<td align="center">渐变工具</td>
<td align="center">G</td>
</tr>
<tr>
<td align="center">文字工具</td>
<td align="center">T</td>
</tr>
<tr>
<td align="center">撤销一次操作</td>
<td align="center">Ctrl + Z</td>
</tr>
<tr>
<td align="center">撤销多次操作</td>
<td align="center">Ctrl  + Shift +Z</td>
</tr>
<tr>
<td align="center">颜色调板</td>
<td align="center">F6</td>
</tr>
<tr>
<td align="center">画笔调板</td>
<td align="center">F5</td>
</tr>
<tr>
<td align="center">信息调板</td>
<td align="center">F8</td>
</tr>
<tr>
<td align="center">动作调板</td>
<td align="center">F9</td>
</tr>
<tr>
<td align="center">新建图层</td>
<td align="center">Ctrl + Shift + N</td>
</tr>
<tr>
<td align="center">向下合并图层</td>
<td align="center">Ctrl + E</td>
</tr>
<tr>
<td align="center">复制选区</td>
<td align="center">Alt + 鼠标拖动</td>
</tr>
<tr>
<td align="center">导出切片</td>
<td align="center">Ctrl + Alt + Shift + S</td>
</tr>
</tbody></table>
<ul>
<li><p>PS操作</p>
<ul>
<li><p>缩放</p>
<p>双击”缩放工具“，可以将图像显示比例调成100%。</p>
<p>Alt+鼠标滚轮可以缩放图像显示比例。</p>
<p>鼠标向左下/右上（左下/右上）移动。</p>
</li>
</ul>
</li>
<li><p>颜色模式</p>
<ul>
<li>灰度：采用256级灰阶，包括黑白</li>
<li>位图：黑白图</li>
<li>RGB：显示色，用于屏幕显示。（网页采用RGB模式）</li>
<li>CMYK：油墨色，也叫打印色。</li>
</ul>
</li>
<li><p>新建文件时分辨率设置</p>
<ul>
<li>用于显示的图像的分辨率设为72ppi左右</li>
<li>一般打印的图像的分辨率为170ppi左右</li>
<li>高精度打印图像分辨率为300ppi左右</li>
</ul>
</li>
<li><p>如果要创建的图像文件最终存为PNG格式，背景要设为透明。</p>
</li>
<li><p>在PS中图像编辑时，实际图像由多个图层构成。</p>
</li>
<li><p>填充：编辑-&gt;填充</p>
</li>
<li><p>工具箱分为</p>
<ul>
<li>选框或选择工具区</li>
<li>绘图区/编辑区</li>
<li>绘矢量图区和文字编辑区</li>
<li>缩放区/颜色/蒙版区</li>
</ul>
</li>
<li><p>补充</p>
<ul>
<li>魔棒工具：选择颜色相近的区域</li>
<li>栅格化：把文字层转化为图层</li>
<li>蒙版：处理选区</li>
</ul>
</li>
<li><p>图层操作</p>
<ul>
<li>锁定图层</li>
<li>图层对齐</li>
<li>创建图层组</li>
<li>调整色阶和</li>
</ul>
</li>
</ul>
<h2 id="10-4-图片优化"><a href="#10-4-图片优化" class="headerlink" title="10.4 图片优化"></a>10.4 图片优化</h2><h3 id="雪碧图（Sprites）制作"><a href="#雪碧图（Sprites）制作" class="headerlink" title="雪碧图（Sprites）制作"></a>雪碧图（Sprites）制作</h3><p>也叫精灵图(一般为PNG格式)，是把多张小图放在一张大图中，目的是<strong>减少服务器请求次数</strong>，达到优化目的。</p>
<ul>
<li><p>优点：</p>
<ul>
<li>减少http请求次数</li>
<li>减少图片数量，提升网页加载速度</li>
<li>减少网络带宽占用</li>
</ul>
</li>
<li><p>缺点</p>
<ul>
<li>提高了网页开发成本和维护成本</li>
<li>合并内容性图片会影响页面的可读性，语义化降低</li>
</ul>
</li>
<li><p>应用场景</p>
<ul>
<li>一般只有描述性图片用来制作雪碧图，比如页面中使用的各种小标。</li>
<li>按钮背景图及其各种效果的图片，适合做成雪碧图。</li>
<li>对于img标签设置的内容性图片，是不能合成到雪碧图中的。</li>
<li>开发游戏中使用的素材图片。</li>
</ul>
</li>
<li><p>制作规范</p>
<ul>
<li>图片在合并之前必须保留空隙</li>
<li>图片排列方式由横向和纵向(最好不要多行多列排)</li>
<li>合并分类规则<ul>
<li>把同属一个模块的图片进行合并</li>
<li>把大小相近的图片进行合并</li>
<li>把色彩相近的图片进行合并</li>
<li>必须保存为PNG格式</li>
</ul>
</li>
</ul>
</li>
<li><p>去水印与版权问题</p>
<ul>
<li>仿制图章工具</li>
<li>修复画笔工具</li>
<li>修补工具</li>
</ul>
</li>
</ul>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">&quot;en&quot;</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">&quot;UTF-8&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>精灵图的使用<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><br><span class="css">        <span class="hljs-selector-tag">ul</span>&#123;</span><br><span class="css">            <span class="hljs-attribute">list-style-type</span>: none;</span><br>        &#125;<br>        .icon1&#123;<br><span class="css">            <span class="hljs-attribute">width</span>: <span class="hljs-number">29px</span>;</span><br><span class="css">            <span class="hljs-attribute">height</span>: <span class="hljs-number">27px</span>;</span><br><span class="css">            <span class="hljs-attribute">display</span>: inline-block;</span><br><span class="css">            <span class="hljs-attribute">background</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">&quot;./imgs/sprites2.png&quot;</span>) -<span class="hljs-number">6px</span> -<span class="hljs-number">6px</span>;</span><br>        &#125;<br>        .icon2&#123;<br><span class="css">            <span class="hljs-attribute">width</span>: <span class="hljs-number">28px</span>;</span><br><span class="css">            <span class="hljs-attribute">height</span>: <span class="hljs-number">27px</span>;</span><br><span class="css">            <span class="hljs-attribute">display</span>: inline-block;</span><br><span class="css">            <span class="hljs-attribute">background</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">&quot;./imgs/sprites2.png&quot;</span>) -<span class="hljs-number">40px</span> -<span class="hljs-number">6px</span>;</span><br>        &#125;<br>        .icon3&#123;<br><span class="css">            <span class="hljs-attribute">width</span>: <span class="hljs-number">26px</span>;</span><br><span class="css">            <span class="hljs-attribute">height</span>: <span class="hljs-number">27px</span>;</span><br><span class="css">            <span class="hljs-attribute">display</span>: inline-block;</span><br><span class="css">            <span class="hljs-attribute">background</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">&quot;./imgs/sprites2.png&quot;</span>) -<span class="hljs-number">73px</span> -<span class="hljs-number">6px</span>;</span><br>        &#125;<br>    <span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;icon1&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>表项1<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;icon2&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>表项2<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;icon3&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>表项3<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span><br></code></pre></td></tr></table></figure>


            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/PthotoShop/">PthotoShop</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/05/10/%E6%95%B0%E6%8D%AE%E5%BA%93%E5%AD%A6%E4%B9%A0/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">数据库笔记</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/05/05/%E5%89%8D%E7%AB%AF%E5%AD%A6%E4%B9%A011/">
                        <span class="hidden-mobile">CSS属性-动画</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->

  <div class="col-lg-7 mx-auto nopadding-x-md">
    <div class="container custom post-custom mx-auto">
      <img src="https://octodex.github.com/images/jetpacktocat.png" srcset="/img/loading.gif" class="rounded mx-auto d-block mt-5" style="width:150px; height:150px;">
    </div>
  </div>


    

    
      <a id="scroll-top-button" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  
  <!-- 备案信息 -->
  <div class="beian">
    <span>
      <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
        京ICP证123456号
      </a>
    </span>
    
      
        <span>
          <a
            href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=12345678"
            rel="nofollow noopener"
            class="beian-police"
            target="_blank"
          >
            
              <span style="visibility: hidden; width: 0">|</span>
              <img src="/img/police_beian.png" srcset="/img/loading.gif" alt="police-icon"/>
            
            <span>京公网安备12345678号</span>
          </a>
        </span>
      
    
  </div>


  
</footer>

<!-- SCRIPTS -->

  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" ></script>
<script  src="/js/debouncer.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/lazyload.js" ></script>
  



  



  <script  src="https://cdn.jsdelivr.net/npm/tocbot@4.12.0/dist/tocbot.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4.3.0/anchor.min.js" ></script>



  <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js" ></script>



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    (function () {
      var path = "/local-search.xml";
      $('#local-search-input').on('click', function() {
        searchFunc(path, 'local-search-input', 'local-search-result');
      });
      $('#modalSearch').on('shown.bs.modal', function() {
        $('#local-search-input').focus();
      });
    })()
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>



<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618,"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"superSample":2,"width":150,"height":300,"position":"right","hOffset":0,"vOffset":-20},"mobile":{"show":true,"scale":0.5},"react":{"opacityDefault":0.7,"opacityOnHover":0.8},"log":false});</script></body>
</html>
